//
//  YBFiveViewController.m
//  GoodBuy
//
//  Created by dlios on 15-5-26.
//  Copyright (c) 2015年 GoodBuy. All rights reserved.
//

#import "YBFiveViewController.h"
#import "YBFiveTableViewCell.h"
@interface YBFiveViewController ()

@end

@implementation YBFiveViewController
- (void)dealloc
{
    [_tableView release];
    [super dealloc];
}
- (void)viewWillAppear:(BOOL)animated {
    self.tabBarController.tabBar.hidden = YES;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createTV];
}
- (void)createTV
{
    self.tableView = [[UITableView alloc]initWithFrame:[[UIScreen mainScreen]bounds] style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource =self;
    _tableView.rowHeight = 150;
    [self.view addSubview:_tableView];
    [_tableView release];


}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIdrntifier = @"cell";
    YBFiveTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdrntifier];
    if (cell == nil) {
        cell = [[YBFiveTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdrntifier];
    }
    
//    ModelDetailChina *forDetai = [_allArray objectAtIndex:indexPath.row];
//    cell.textLabel.text = forDetai.article_title;
    cell.Stu = _allArray[indexPath.row];
    return cell;
}


-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [_allArray count];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    ChinaDetailViewController *datailVc = [[ChinaDetailViewController alloc] init];
    datailVc.article_id = [[_allArray objectAtIndex:indexPath.row]article_id];
//    datailVc.chinalist = [_allArray objectAtIndex:indexPath.row];
    
    [self.navigationController pushViewController:datailVc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
